<?php


namespace Lib\Loaders;


use Base\LoaderInterface;
use EasySwoole\Component\Di;

class MiddlewareLoader implements LoaderInterface
{
    public static function handle()
    {
        $sortFilePath = EASYSWOOLE_ROOT . '/App/Middlewares/Sort.php';
        if (file_exists($sortFilePath)) {
            $middlewares = include_once($sortFilePath);
            Di::getInstance()->set('middlewares', $middlewares);
        }
    }
}
